#include <cstdio>
#include <cstring>

char *p, s[(int)1e6];

int main( int argc, char *argv[] )
{
  while (gets(s))
  {
    puts(s);
    if ((p = strstr(s, argv[1])) != 0)
    {
      p += strlen(argv[1]);
      for (char *t = s; t < p; t++)
        putchar(*t);
      printf("up");
      puts(p);
    }
  }
  return 0;
}
